#pragma once

#include <pcl/io/pcd_io.h> //pcl读写类相关
#include <pcl/point_types.h>//PCL中支持的点类型头文件
#include <pcl/point_cloud.h>
#include <pcl/visualization/cloud_viewer.h>

#include <pcl/io/ply_io.h>
#include <iostream>
#include <string> 
// OpenCV 库
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
using namespace std;

typedef pcl::PointXYZRGBA PointT;
typedef pcl::PointCloud<PointT> PointCloud;
class PclViewTools{
public :
    PclViewTools();
    ~PclViewTools();
private:
    // 定义点云类型

public:
    int VisualPCDTool(const string & inputPath);
    int DepthToCloudPCD(const cv::Mat &rgb, const cv::Mat& depth, const string & savePath);
    // int DepthToCloud(const cv::Mat& depth, const string & savePath);
    int DepthToCloud(const cv::Mat &rgb , const cv::Mat &depth, pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud );
    int readSTLModel(const string& path);
    int Visual3DTool(const PointCloud::Ptr& pcloud);
    // int AddObjectTool(PointCloud::Ptr& pcloud);
    // int LoadPLYModel(PointCloud::Ptr& pcloud, const string & path);

    // 相机内参 kinect 527.6911 , 0, 478.74231, 0, 528.01282, 266.14407, 0, 0, 1;

    /*
     * fx 0  cx
     * 0  fy cy
     * 0  0  1 
     */
    const double camera_factor = 1000;
    const double camera_fx = 525.6911;
    const double camera_fy = 525.01282;
    const double camera_cx = 478.74231;
    const double camera_cy = 266.14407;


    //    tmpMat_ << 527.6911 , 0, 478.74231, 
    //0, 528.01282, 266.14407, 
    //0, 0, 1;

};